package model;

import java.util.ArrayList;
import java.util.LinkedHashMap;
import java.util.List;
import java.util.Map;

import tests.PopulateData;

public class RequestDAO {
	// Init ---------------------------------------------------------------------------------------

    private static final Map<Long, Request> POPULATE_REQUESTS_DATA = (Map<Long, Request>) PopulateData.populateRequestsData(10);
	private static Map<Long, Request> requestMap = POPULATE_REQUESTS_DATA;

    // Actions ------------------------------------------------------------------------------------

    public Request find(Long key) {
        return requestMap.get(key);
    }

    public static List<Request> list() {
        return new ArrayList<Request>(requestMap.values());
    }

    public Map<Long, Request> map() {
        return requestMap;
    }
    
    public static void addDistr(Request request) {
    	requestMap.put((long) request.getId(), request);
    }
    
    // Helpers ------------------------------------------------------------------------------------
    
}
